<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateFeishuCallingCardUserSourcesTable extends Migration
{
    /**
     * 微信小程序来访记录日志表
     *
     * @return void
     */
    public function up()
    {
        Schema::create('feishu_calling_card_user_sources', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('userId')->default(0)->comment('feishu_calling_card_users.id');
            $table->unsignedTinyInteger('shareType')->default(0)->comment('分享来源类型,1-飞书名片海报,2-文章海报');
            $table->string('wechatScene', 16)->default('')->comment('微信小程序打开的场景码');
            $table->unsignedInteger('invitorId')->default(0)->comment('邀请人id');
            $table->unsignedInteger('urlId')->default(0)->comment('微信公众号文章Url的id');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->comment = '加盟名片 - 微信小程序来访记录日志表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('feishu_calling_card_user_sources');
    }
}
